<?php
namespace app\backend\validate;
use app\common\RootValidate;

class RoleValidate extends RootValidate
{
    protected $rule = [
        'roleId' => 'require|integer|gt:0',
        'roleName' => 'require',
        'authList' => 'require|array'
    ];

    protected $message = [
        'roleId.require' => '角色无效',
        'roleId.integer' => '角色ID必须是整形',
        'roleId.gt' => '角色不存在',
        'roleName.require' => '角色名称不能为空',
        'authList.require' => '请配置角色权限',
        'authList.array' => '角色权限无效'
    ];

    protected $scene = [
        'add' => ['roleName', 'authList'],
        'edit' => ['roleId', 'authList'],
    ];
}